package Aaaaaa;


import java.util.Comparator;
import java.util.PriorityQueue;

public class Main17 {
    public static void main(String[] args) {
        int[] arr={1 ,6,5,9,4,6,7 };
        PriorityQueue<Integer> p=new PriorityQueue<>(new Comparator<Integer>() {
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });
        for (int i : arr) {
            p.offer(i);
        }
        System.out.println(p.poll());
        System.out.println(p.poll());
    }
}
